using System;
using System.Collections.Generic;
using System.Text;

namespace NBusiness.Utilities
{
    public static class ArrayUtil
    {
        public static T[] Combine<T>(T[] t1, T[] t2)
        {
            T[] t = new T[t1.Length + t2.Length];
            t1.CopyTo(t, 0);
            t2.CopyTo(t, t1.Length);
            return t;
        }

        public static bool AreEqual<T>(T[] t1, T[] t2)
        {
            if ((t1 != null) || (t2 != null))
            {
                if ((t1 == null) || (t2 == null))
                {
                    return false;
                }
                if (t1.Length != t2.Length)
                {
                    return false;
                }
                for (int i = 0; i < t1.Length; i++)
                {
                    if (!t1[i].Equals(t2[i]))
                    {
                        return false;
                    }
                }
            }
            return true;
        }
    }
}
